#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
void input_score(float x[]);//函数声明
void aver_score(float x, float y, float i);//函数声明
float aver_subject(float x[]);
int main()
{
	float arr1[10] = { 0.0 };
	float arr2[10] = { 0.0 };
	float arr3[10] = { 0.0 };
	int i = 0;
	int j = 0;
	int m = 0;
	printf("please input math scores\n");//输入成绩
	input_score(arr1);
	printf("please input English scores\n");
	input_score(arr2);
	printf("please input Chinese scores\n");
	input_score(arr3);
	printf("students'math scores:\n");
	for (j = 0; j < 10; j++)//打印成绩
	{
		printf("%.0f ", arr1[j]);
	}
	printf("\n");
	printf("students'English scores:\n");
	for (j = 0; j < 10; j++)
	{
		printf("%.0f ", arr2[j]);
	}
	printf("\n");
	printf("students'Chinese scores:\n");
	for (j = 0; j < 10; j++)
	{
		printf("%.0f ", arr3[j]);
	}
	printf("\n");
	printf("students'average score:\n");//平均数
	for (i = 0, j = 0, m = 0; i < 10; i++, j++, m++)
	{
		aver_score(arr1[i], arr2[j], arr3[m]);
	}
	printf("\n");
	printf("math的平均成绩为：%f\n", aver_subject(arr1));
	printf("English的平均成绩为：%f\n" ,aver_subject(arr2));
	printf("Chinese的平均成绩为：%f\n" ,aver_subject(arr3));
	return 0;
}
void input_score(float x[])//输入成绩
{
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		scanf("%f",&x[i]);
	}
}
void aver_score(float x,float y,float i)//求每个人的平均成绩
{
	float c = (x+y+i)/3;
	printf("%.2f ", c);
}
float aver_subject(float x[])
{
	int i = 0;
	int sum = 0;
	for (i = 0; i < 10; i++)
	{
		sum += x[i];
	}
	float c = sum / 10;
	return c;
}